package cn.cdeden.knowledge.domain.dto;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

/**
 * @ProjectName : ecm_svn
 * @Package : com.cdyd.ecm.modules.synergy.domain.enums
 * @ClassName : SynergyFileUserEnums
 * @Author : Yu.
 * @Description : // TODO
 * @Date : 2024/4/12 16:02
 * @Version : 1.0
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum SynergyFileUserEnums {


    Owner("owner","所有者",0,"所有者只可以有一个不可以设置多个"),
    synergy_admin("synergy_admin","管理员",1,"请联系管理设置权限"),
    edit("edit","可编辑",2,"请联系管理设置可编辑权限"),
    read("read","可阅读",3,"请联系管理设置可预览权限"),

    ;

    private String code;
    private String name;
    private Integer permissions;
    private String prompt;


    public static SynergyFileUserEnums find(String code) {
        for (SynergyFileUserEnums value : SynergyFileUserEnums.values()) {
            if (StringUtils.equalsIgnoreCase(code,value.getCode())) {
                return value;
            }
        }
        return read;
    }



}
